/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    'cn-qingdao' = 'apigateway.cn-qingdao.aliyuncs.com',
    'cn-beijing' = 'apigateway.cn-beijing.aliyuncs.com',
    'cn-zhangjiakou' = 'apigateway.cn-zhangjiakou.aliyuncs.com',
    'cn-huhehaote' = 'apigateway.cn-huhehaote.aliyuncs.com',
    'cn-wulanchabu' = 'apigateway.cn-wulanchabu.aliyuncs.com',
    'cn-hangzhou' = 'apigateway.cn-hangzhou.aliyuncs.com',
    'cn-shanghai' = 'apigateway.cn-shanghai.aliyuncs.com',
    'cn-shenzhen' = 'apigateway.cn-shenzhen.aliyuncs.com',
    'cn-heyuan' = 'apigateway.cn-heyuan.aliyuncs.com',
    'cn-guangzhou' = 'apigateway.cn-guangzhou.aliyuncs.com',
    'cn-chengdu' = 'apigateway.cn-chengdu.aliyuncs.com',
    'cn-hongkong' = 'apigateway.cn-hongkong.aliyuncs.com',
    'ap-northeast-1' = 'apigateway.ap-northeast-1.aliyuncs.com',
    'ap-southeast-1' = 'apigateway.ap-southeast-1.aliyuncs.com',
    'ap-southeast-2' = 'apigateway.ap-southeast-2.aliyuncs.com',
    'ap-southeast-3' = 'apigateway.ap-southeast-3.aliyuncs.com',
    'ap-southeast-5' = 'apigateway.ap-southeast-5.aliyuncs.com',
    'ap-southeast-6' = 'apigateway.ap-southeast-6.aliyuncs.com',
    'ap-southeast-7' = 'apigateway.ap-southeast-7.aliyuncs.com',
    'us-east-1' = 'apigateway.us-east-1.aliyuncs.com',
    'us-west-1' = 'apigateway.us-west-1.aliyuncs.com',
    'eu-west-1' = 'apigateway.eu-west-1.aliyuncs.com',
    'eu-central-1' = 'apigateway.eu-central-1.aliyuncs.com',
    'ap-south-1' = 'apigateway.ap-south-1.aliyuncs.com',
    'me-east-1' = 'apigateway.me-east-1.aliyuncs.com',
    'me-central-1' = 'apigateway.me-central-1.aliyuncs.com',
    'cn-hangzhou-finance' = 'apigateway.cn-hangzhou-finance.aliyuncs.com',
    'cn-shanghai-finance-1' = 'apigateway.cn-shanghai-finance-1.aliyuncs.com',
    'cn-shenzhen-finance-1' = 'apigateway.cn-shenzhen-finance-1.aliyuncs.com',
    'cn-north-2-gov-1' = 'apigateway.cn-north-2-gov-1.aliyuncs.com',
    'ap-northeast-2-pop' = 'apigateway.aliyuncs.com',
    'cn-beijing-finance-1' = 'apigateway.cn-beijing-finance-1.aliyuncs.com',
    'cn-beijing-finance-pop' = 'apigateway.aliyuncs.com',
    'cn-beijing-gov-1' = 'apigateway.aliyuncs.com',
    'cn-beijing-nu16-b01' = 'apigateway.aliyuncs.com',
    'cn-edge-1' = 'apigateway.aliyuncs.com',
    'cn-fujian' = 'apigateway.aliyuncs.com',
    'cn-haidian-cm12-c01' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-bj-b01' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-internal-prod-1' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-internal-test-1' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-internal-test-2' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-internal-test-3' = 'apigateway.aliyuncs.com',
    'cn-hangzhou-test-306' = 'apigateway.aliyuncs.com',
    'cn-hongkong-finance-pop' = 'apigateway.aliyuncs.com',
    'cn-huhehaote-nebula-1' = 'apigateway.aliyuncs.com',
    'cn-qingdao-nebula' = 'apigateway.aliyuncs.com',
    'cn-shanghai-et15-b01' = 'apigateway.aliyuncs.com',
    'cn-shanghai-et2-b01' = 'apigateway.aliyuncs.com',
    'cn-shanghai-inner' = 'apigateway.cn-shanghai-inner.aliyuncs.com',
    'cn-shanghai-internal-test-1' = 'apigateway.aliyuncs.com',
    'cn-shenzhen-inner' = 'apigateway.aliyuncs.com',
    'cn-shenzhen-st4-d01' = 'apigateway.aliyuncs.com',
    'cn-shenzhen-su18-b01' = 'apigateway.aliyuncs.com',
    'cn-wuhan' = 'apigateway.aliyuncs.com',
    'cn-yushanfang' = 'apigateway.aliyuncs.com',
    'cn-zhangbei' = 'apigateway.aliyuncs.com',
    'cn-zhangbei-na61-b01' = 'apigateway.aliyuncs.com',
    'cn-zhangjiakou-na62-a01' = 'apigateway.aliyuncs.com',
    'cn-zhengzhou-nebula-1' = 'apigateway.aliyuncs.com',
    'eu-west-1-oxs' = 'apigateway.aliyuncs.com',
    'rus-west-1-pop' = 'apigateway.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('cloudapi', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CheckAoneAppAuditRequest {
  aoneAppName?: string(name='AoneAppName'),
  securityToken?: string(name='SecurityToken'),
}

model CheckAoneAppAuditResponseBody = {
  checkResult?: boolean(name='CheckResult'),
  requestId?: string(name='RequestId'),
}

model CheckAoneAppAuditResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CheckAoneAppAuditResponseBody(name='body'),
}

async function checkAoneAppAuditWithOptions(request: CheckAoneAppAuditRequest, runtime: Util.RuntimeOptions): CheckAoneAppAuditResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aoneAppName)) {
    query['AoneAppName'] = request.aoneAppName;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CheckAoneAppAudit',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function checkAoneAppAudit(request: CheckAoneAppAuditRequest): CheckAoneAppAuditResponse {
  var runtime = new Util.RuntimeOptions{};
  return checkAoneAppAuditWithOptions(request, runtime);
}

model CreateApiGroupRequest {
  description?: string(name='Description'),
  groupName?: string(name='GroupName'),
  securityToken?: string(name='SecurityToken'),
}

model CreateApiGroupResponseBody = {
  description?: string(name='Description'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  requestId?: string(name='RequestId'),
  subDomain?: string(name='SubDomain'),
}

model CreateApiGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateApiGroupResponseBody(name='body'),
}

async function createApiGroupWithOptions(request: CreateApiGroupRequest, runtime: Util.RuntimeOptions): CreateApiGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateApiGroup',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createApiGroup(request: CreateApiGroupRequest): CreateApiGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createApiGroupWithOptions(request, runtime);
}

model CreateAppForBackendRequest {
  aliUid?: long(name='AliUid'),
  appName?: string(name='AppName'),
  description?: string(name='Description'),
  securityToken?: string(name='SecurityToken'),
  source?: string(name='Source'),
}

model CreateAppForBackendResponseBody = {
  appId?: long(name='AppId'),
  requestId?: string(name='RequestId'),
}

model CreateAppForBackendResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAppForBackendResponseBody(name='body'),
}

async function createAppForBackendWithOptions(request: CreateAppForBackendRequest, runtime: Util.RuntimeOptions): CreateAppForBackendResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppForBackend',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppForBackend(request: CreateAppForBackendRequest): CreateAppForBackendResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppForBackendWithOptions(request, runtime);
}

model CreateAppForInnerRequest {
  aliUid?: long(name='AliUid'),
  appCode?: string(name='AppCode'),
  appKey?: string(name='AppKey'),
  appName?: string(name='AppName'),
  appSecret?: string(name='AppSecret'),
  description?: string(name='Description'),
  extend?: string(name='Extend'),
  securityToken?: string(name='SecurityToken'),
  source?: string(name='Source'),
}

model CreateAppForInnerResponseBody = {
  appId?: long(name='AppId'),
  requestId?: string(name='RequestId'),
}

model CreateAppForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateAppForInnerResponseBody(name='body'),
}

async function createAppForInnerWithOptions(request: CreateAppForInnerRequest, runtime: Util.RuntimeOptions): CreateAppForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appCode)) {
    query['AppCode'] = request.appCode;
  }
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.appSecret)) {
    query['AppSecret'] = request.appSecret;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.extend)) {
    query['Extend'] = request.extend;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.source)) {
    query['Source'] = request.source;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateAppForInner',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createAppForInner(request: CreateAppForInnerRequest): CreateAppForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return createAppForInnerWithOptions(request, runtime);
}

model CreateInstanceRequest {
  accountQuantity?: long(name='AccountQuantity'),
  alarmQuota?: long(name='AlarmQuota'),
  aliUid?: long(name='AliUid'),
  appId?: long(name='AppId'),
  billingType?: string(name='BillingType'),
  cloudMarketInstanceId?: string(name='CloudMarketInstanceId'),
  expiredOn?: string(name='ExpiredOn'),
  instanceAttributes?: string(name='InstanceAttributes'),
  securityToken?: string(name='SecurityToken'),
  skuId?: string(name='SkuId'),
  token?: string(name='Token'),
}

model CreateInstanceResponseBody = {
  instanceId?: string(name='InstanceId'),
  requestId?: string(name='RequestId'),
}

model CreateInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateInstanceResponseBody(name='body'),
}

async function createInstanceWithOptions(request: CreateInstanceRequest, runtime: Util.RuntimeOptions): CreateInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.accountQuantity)) {
    query['AccountQuantity'] = request.accountQuantity;
  }
  if (!Util.isUnset(request.alarmQuota)) {
    query['AlarmQuota'] = request.alarmQuota;
  }
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.billingType)) {
    query['BillingType'] = request.billingType;
  }
  if (!Util.isUnset(request.cloudMarketInstanceId)) {
    query['CloudMarketInstanceId'] = request.cloudMarketInstanceId;
  }
  if (!Util.isUnset(request.expiredOn)) {
    query['ExpiredOn'] = request.expiredOn;
  }
  if (!Util.isUnset(request.instanceAttributes)) {
    query['InstanceAttributes'] = request.instanceAttributes;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.skuId)) {
    query['SkuId'] = request.skuId;
  }
  if (!Util.isUnset(request.token)) {
    query['Token'] = request.token;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateInstance',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createInstance(request: CreateInstanceRequest): CreateInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return createInstanceWithOptions(request, runtime);
}

model CreateUserWhiteListRequest {
  aoneId?: string(name='AoneId'),
  description?: string(name='Description'),
  entityId?: string(name='EntityId'),
  limitCount?: int32(name='LimitCount'),
  securityToken?: string(name='SecurityToken'),
  type?: string(name='Type'),
  uid?: long(name='Uid'),
  value?: string(name='Value'),
}

model CreateUserWhiteListResponseBody = {
  requestId?: string(name='RequestId'),
}

model CreateUserWhiteListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateUserWhiteListResponseBody(name='body'),
}

async function createUserWhiteListWithOptions(request: CreateUserWhiteListRequest, runtime: Util.RuntimeOptions): CreateUserWhiteListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aoneId)) {
    query['AoneId'] = request.aoneId;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.limitCount)) {
    query['LimitCount'] = request.limitCount;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!Util.isUnset(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateUserWhiteList',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createUserWhiteList(request: CreateUserWhiteListRequest): CreateUserWhiteListResponse {
  var runtime = new Util.RuntimeOptions{};
  return createUserWhiteListWithOptions(request, runtime);
}

model DeleteApiGroupRequest {
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteApiGroupResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteApiGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteApiGroupResponseBody(name='body'),
}

async function deleteApiGroupWithOptions(request: DeleteApiGroupRequest, runtime: Util.RuntimeOptions): DeleteApiGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApiGroup',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteApiGroup(request: DeleteApiGroupRequest): DeleteApiGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteApiGroupWithOptions(request, runtime);
}

model DeleteAppForInnerRequest {
  aliUid?: long(name='AliUid'),
  appId?: long(name='AppId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteAppForInnerResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteAppForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAppForInnerResponseBody(name='body'),
}

async function deleteAppForInnerWithOptions(request: DeleteAppForInnerRequest, runtime: Util.RuntimeOptions): DeleteAppForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAppForInner',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAppForInner(request: DeleteAppForInnerRequest): DeleteAppForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppForInnerWithOptions(request, runtime);
}

model DeleteSecretKeyRequest {
  secretKeyId?: string(name='SecretKeyId'),
  securityToken?: string(name='SecurityToken'),
}

model DeleteSecretKeyResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteSecretKeyResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteSecretKeyResponseBody(name='body'),
}

async function deleteSecretKeyWithOptions(request: DeleteSecretKeyRequest, runtime: Util.RuntimeOptions): DeleteSecretKeyResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.secretKeyId)) {
    query['SecretKeyId'] = request.secretKeyId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteSecretKey',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteSecretKey(request: DeleteSecretKeyRequest): DeleteSecretKeyResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteSecretKeyWithOptions(request, runtime);
}

model DeleteUserWhiteListByTypeRequest {
  entityId?: string(name='EntityId'),
  securityToken?: string(name='SecurityToken'),
  type?: string(name='Type'),
  uid?: long(name='Uid'),
}

model DeleteUserWhiteListByTypeResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteUserWhiteListByTypeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserWhiteListByTypeResponseBody(name='body'),
}

async function deleteUserWhiteListByTypeWithOptions(request: DeleteUserWhiteListByTypeRequest, runtime: Util.RuntimeOptions): DeleteUserWhiteListByTypeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.entityId)) {
    query['EntityId'] = request.entityId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserWhiteListByType',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteUserWhiteListByType(request: DeleteUserWhiteListByTypeRequest): DeleteUserWhiteListByTypeResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserWhiteListByTypeWithOptions(request, runtime);
}

model DescribeApiDocRequest {
  apiId?: string(name='ApiId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeApiDocResponseBody = {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  bodyFormat?: string(name='BodyFormat'),
  deployedTime?: string(name='DeployedTime'),
  description?: string(name='Description'),
  errorCodeSamples?: {
    errorCodeSample?: [ 
    {
      code?: string(name='Code'),
      description?: string(name='Description'),
      message?: string(name='Message'),
    }
  ](name='ErrorCodeSample')
  }(name='ErrorCodeSamples'),
  failResultSample?: string(name='FailResultSample'),
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  httpMethod?: string(name='HttpMethod'),
  httpProtocol?: string(name='HttpProtocol'),
  path?: string(name='Path'),
  pathParameters?: {
    pathParameter?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
    }
  ](name='PathParameter')
  }(name='PathParameters'),
  postBodyDescription?: string(name='PostBodyDescription'),
  postBodyType?: string(name='PostBodyType'),
  regionId?: string(name='RegionId'),
  requestBody?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestBody'),
  requestHeaders?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestHeaders'),
  requestId?: string(name='RequestId'),
  requestQueries?: {
    requestParam?: [ 
    {
      apiParameterName?: string(name='ApiParameterName'),
      defaultValue?: string(name='DefaultValue'),
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      enumValue?: string(name='EnumValue'),
      jsonScheme?: string(name='JsonScheme'),
      maxLength?: long(name='MaxLength'),
      maxValue?: long(name='MaxValue'),
      minLength?: long(name='MinLength'),
      minValue?: long(name='MinValue'),
      parameterType?: string(name='ParameterType'),
      regularExpression?: string(name='RegularExpression'),
      required?: string(name='Required'),
    }
  ](name='RequestParam')
  }(name='RequestQueries'),
  resultDescriptions?: {
    resultDescription?: [ 
    {
      description?: string(name='Description'),
      hasChild?: boolean(name='HasChild'),
      id?: string(name='Id'),
      key?: string(name='Key'),
      mandatory?: boolean(name='Mandatory'),
      name?: string(name='Name'),
      pid?: string(name='Pid'),
      type?: string(name='Type'),
    }
  ](name='ResultDescription')
  }(name='ResultDescriptions'),
  resultSample?: string(name='ResultSample'),
  resultType?: string(name='ResultType'),
  sdkDemos?: {
    sdkDemo?: [ 
    {
      callDemo?: string(name='CallDemo'),
      ideKey?: string(name='IdeKey'),
    }
  ](name='SdkDemo')
  }(name='SdkDemos'),
  serviceTimeout?: int32(name='ServiceTimeout'),
  stageName?: string(name='StageName'),
}

model DescribeApiDocResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApiDocResponseBody(name='body'),
}

async function describeApiDocWithOptions(request: DescribeApiDocRequest, runtime: Util.RuntimeOptions): DescribeApiDocResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiDoc',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiDoc(request: DescribeApiDocRequest): DescribeApiDocResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiDocWithOptions(request, runtime);
}

model DescribeApiDocsRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeApiDocsResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      deployedTime?: string(name='DeployedTime'),
      description?: string(name='Description'),
      groupDescription?: string(name='GroupDescription'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      regionId?: string(name='RegionId'),
      stageName?: string(name='StageName'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApiDocsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApiDocsResponseBody(name='body'),
}

async function describeApiDocsWithOptions(request: DescribeApiDocsRequest, runtime: Util.RuntimeOptions): DescribeApiDocsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiDocs',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiDocs(request: DescribeApiDocsRequest): DescribeApiDocsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiDocsWithOptions(request, runtime);
}

model DescribeApiGroupsRequest {
  groupId?: string(name='GroupId'),
  groupName?: string(name='GroupName'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeApiGroupsResponseBody = {
  apiGroupAttributes?: {
    apiGroupAttribute?: [ 
    {
      billingStatus?: string(name='BillingStatus'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      illegalStatus?: string(name='IllegalStatus'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      subDomain?: string(name='SubDomain'),
      trafficLimit?: int32(name='TrafficLimit'),
    }
  ](name='ApiGroupAttribute')
  }(name='ApiGroupAttributes'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApiGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApiGroupsResponseBody(name='body'),
}

async function describeApiGroupsWithOptions(request: DescribeApiGroupsRequest, runtime: Util.RuntimeOptions): DescribeApiGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.groupName)) {
    query['GroupName'] = request.groupName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiGroups',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiGroups(request: DescribeApiGroupsRequest): DescribeApiGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiGroupsWithOptions(request, runtime);
}

model DescribeApiMarketInstanceRequest {
  aliUid?: string(name='AliUid'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeApiMarketInstanceResponseBody = {
  instanceAttributes?: string(name='InstanceAttributes'),
  requestId?: string(name='RequestId'),
}

model DescribeApiMarketInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApiMarketInstanceResponseBody(name='body'),
}

async function describeApiMarketInstanceWithOptions(request: DescribeApiMarketInstanceRequest, runtime: Util.RuntimeOptions): DescribeApiMarketInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApiMarketInstance',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApiMarketInstance(request: DescribeApiMarketInstanceRequest): DescribeApiMarketInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApiMarketInstanceWithOptions(request, runtime);
}

model DescribeApisRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  visibility?: string(name='Visibility'),
}

model DescribeApisResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      visibility?: string(name='Visibility'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApisResponseBody(name='body'),
}

async function describeApisWithOptions(request: DescribeApisRequest, runtime: Util.RuntimeOptions): DescribeApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.visibility)) {
    query['Visibility'] = request.visibility;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApis',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApis(request: DescribeApisRequest): DescribeApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApisWithOptions(request, runtime);
}

model DescribeApisForConsoleRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
  visibility?: string(name='Visibility'),
}

model DescribeApisForConsoleResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      createdTime?: string(name='CreatedTime'),
      deployedInfos?: {
        deployedInfo?: [ 
        {
          deployedStatus?: string(name='DeployedStatus'),
          effectiveVersion?: string(name='EffectiveVersion'),
          stageName?: string(name='StageName'),
        }
      ](name='DeployedInfo')
      }(name='DeployedInfos'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      visibility?: string(name='Visibility'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeApisForConsoleResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeApisForConsoleResponseBody(name='body'),
}

async function describeApisForConsoleWithOptions(request: DescribeApisForConsoleRequest, runtime: Util.RuntimeOptions): DescribeApisForConsoleResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  if (!Util.isUnset(request.visibility)) {
    query['Visibility'] = request.visibility;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApisForConsole',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApisForConsole(request: DescribeApisForConsoleRequest): DescribeApisForConsoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeApisForConsoleWithOptions(request, runtime);
}

model DescribeAppSecuritiesRequest {
  appId?: long(name='AppId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeAppSecuritiesResponseBody = {
  appSecuritys?: {
    appSecurity?: [ 
    {
      appCode?: string(name='AppCode'),
      appKey?: string(name='AppKey'),
      appSecret?: string(name='AppSecret'),
      createdTime?: string(name='CreatedTime'),
      modifiedTime?: string(name='ModifiedTime'),
    }
  ](name='AppSecurity')
  }(name='AppSecuritys'),
  requestId?: string(name='RequestId'),
}

model DescribeAppSecuritiesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAppSecuritiesResponseBody(name='body'),
}

async function describeAppSecuritiesWithOptions(request: DescribeAppSecuritiesRequest, runtime: Util.RuntimeOptions): DescribeAppSecuritiesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppSecurities',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAppSecurities(request: DescribeAppSecuritiesRequest): DescribeAppSecuritiesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppSecuritiesWithOptions(request, runtime);
}

model DescribeAppSecurityForInnerRequest {
  aliUid?: long(name='AliUid'),
  appId?: long(name='AppId'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeAppSecurityForInnerResponseBody = {
  appCode?: string(name='AppCode'),
  appKey?: string(name='AppKey'),
  appSecret?: string(name='AppSecret'),
  createdTime?: string(name='CreatedTime'),
  modifiedTime?: string(name='ModifiedTime'),
  requestId?: string(name='RequestId'),
}

model DescribeAppSecurityForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAppSecurityForInnerResponseBody(name='body'),
}

async function describeAppSecurityForInnerWithOptions(request: DescribeAppSecurityForInnerRequest, runtime: Util.RuntimeOptions): DescribeAppSecurityForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAppSecurityForInner',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAppSecurityForInner(request: DescribeAppSecurityForInnerRequest): DescribeAppSecurityForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppSecurityForInnerWithOptions(request, runtime);
}

model DescribeAppsRequest {
  appId?: long(name='AppId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeAppsResponseBody = {
  apps?: {
    app?: [ 
    {
      appId?: long(name='AppId'),
      appName?: string(name='AppName'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      modifiedTime?: string(name='ModifiedTime'),
    }
  ](name='App')
  }(name='Apps'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeAppsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAppsResponseBody(name='body'),
}

async function describeAppsWithOptions(request: DescribeAppsRequest, runtime: Util.RuntimeOptions): DescribeAppsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeApps',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeApps(request: DescribeAppsRequest): DescribeAppsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAppsWithOptions(request, runtime);
}

model DescribeAvailableVipsRequest {
  securityToken?: string(name='SecurityToken'),
  vip?: string(name='Vip'),
}

model DescribeAvailableVipsResponseBody = {
  availableVips?: {
    availableVip?: [ string ](name='AvailableVip')
  }(name='AvailableVips'),
}

model DescribeAvailableVipsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeAvailableVipsResponseBody(name='body'),
}

async function describeAvailableVipsWithOptions(request: DescribeAvailableVipsRequest, runtime: Util.RuntimeOptions): DescribeAvailableVipsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.vip)) {
    query['Vip'] = request.vip;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeAvailableVips',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeAvailableVips(request: DescribeAvailableVipsRequest): DescribeAvailableVipsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeAvailableVipsWithOptions(request, runtime);
}

model DescribeBidByUserIdForInnerRequest {
  aliUid?: long(name='AliUid'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeBidByUserIdForInnerResponseBody = {
  bid?: string(name='Bid'),
  requestId?: string(name='RequestId'),
}

model DescribeBidByUserIdForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeBidByUserIdForInnerResponseBody(name='body'),
}

async function describeBidByUserIdForInnerWithOptions(request: DescribeBidByUserIdForInnerRequest, runtime: Util.RuntimeOptions): DescribeBidByUserIdForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeBidByUserIdForInner',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeBidByUserIdForInner(request: DescribeBidByUserIdForInnerRequest): DescribeBidByUserIdForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeBidByUserIdForInnerWithOptions(request, runtime);
}

model DescribeDeployedApisRequest {
  apiId?: string(name='ApiId'),
  apiName?: string(name='ApiName'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
}

model DescribeDeployedApisResponseBody = {
  apiInfos?: {
    apiInfo?: [ 
    {
      apiId?: string(name='ApiId'),
      apiName?: string(name='ApiName'),
      deployedTime?: string(name='DeployedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      regionId?: string(name='RegionId'),
      stageName?: string(name='StageName'),
      visibility?: string(name='Visibility'),
    }
  ](name='ApiInfo')
  }(name='ApiInfos'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeDeployedApisResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeDeployedApisResponseBody(name='body'),
}

async function describeDeployedApisWithOptions(request: DescribeDeployedApisRequest, runtime: Util.RuntimeOptions): DescribeDeployedApisResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiId)) {
    query['ApiId'] = request.apiId;
  }
  if (!Util.isUnset(request.apiName)) {
    query['ApiName'] = request.apiName;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeDeployedApis',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeDeployedApis(request: DescribeDeployedApisRequest): DescribeDeployedApisResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeDeployedApisWithOptions(request, runtime);
}

model DescribeModelsForInnerRequest {
  aliUid?: long(name='AliUid'),
  groupId?: string(name='GroupId'),
  modelId?: string(name='ModelId'),
  modelName?: string(name='ModelName'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeModelsForInnerResponseBody = {
  modelDetails?: {
    modelDetail?: [ 
    {
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      groupId?: string(name='GroupId'),
      modelName?: string(name='ModelName'),
      modelRef?: string(name='ModelRef'),
      modifiedTime?: string(name='ModifiedTime'),
      schema?: string(name='Schema'),
    }
  ](name='ModelDetail')
  }(name='ModelDetails'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeModelsForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeModelsForInnerResponseBody(name='body'),
}

async function describeModelsForInnerWithOptions(request: DescribeModelsForInnerRequest, runtime: Util.RuntimeOptions): DescribeModelsForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.modelId)) {
    query['ModelId'] = request.modelId;
  }
  if (!Util.isUnset(request.modelName)) {
    query['ModelName'] = request.modelName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeModelsForInner',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeModelsForInner(request: DescribeModelsForInnerRequest): DescribeModelsForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeModelsForInnerWithOptions(request, runtime);
}

model DescribePurchasedApiGroupsRequest {
  groupIds?: string(name='GroupIds'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
}

model DescribePurchasedApiGroupsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  purchasedApiGroupAttributes?: {
    purchasedApiGroupAttribute?: [ 
    {
      billingType?: string(name='BillingType'),
      createdTime?: string(name='CreatedTime'),
      expireTime?: string(name='ExpireTime'),
      groupDescription?: string(name='GroupDescription'),
      groupId?: string(name='GroupId'),
      groupName?: string(name='GroupName'),
      invokeTimesMax?: long(name='InvokeTimesMax'),
      invokeTimesNow?: long(name='InvokeTimesNow'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      status?: string(name='Status'),
    }
  ](name='PurchasedApiGroupAttribute')
  }(name='PurchasedApiGroupAttributes'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model DescribePurchasedApiGroupsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePurchasedApiGroupsResponseBody(name='body'),
}

async function describePurchasedApiGroupsWithOptions(request: DescribePurchasedApiGroupsRequest, runtime: Util.RuntimeOptions): DescribePurchasedApiGroupsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.groupIds)) {
    query['GroupIds'] = request.groupIds;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePurchasedApiGroups',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describePurchasedApiGroups(request: DescribePurchasedApiGroupsRequest): DescribePurchasedApiGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePurchasedApiGroupsWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  language?: string(name='Language'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeRegionsResponseBody = {
  regions?: {
    region?: [ 
    {
      endPoint?: string(name='EndPoint'),
      localName?: string(name='LocalName'),
      regionId?: string(name='RegionId'),
    }
  ](name='Region')
  }(name='Regions'),
  requestId?: string(name='RequestId'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.language)) {
    query['Language'] = request.language;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeSecretKeysRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  secretKeyId?: string(name='SecretKeyId'),
  secretKeyName?: string(name='SecretKeyName'),
  securityToken?: string(name='SecurityToken'),
}

model DescribeSecretKeysResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  secretKeys?: {
    secretKey?: [ 
    {
      createdTime?: string(name='CreatedTime'),
      modifiedTime?: string(name='ModifiedTime'),
      regionId?: string(name='RegionId'),
      secretKey?: string(name='SecretKey'),
      secretKeyId?: string(name='SecretKeyId'),
      secretKeyName?: string(name='SecretKeyName'),
      secretKeyValue?: string(name='SecretKeyValue'),
    }
  ](name='SecretKey')
  }(name='SecretKeys'),
  totalCount?: int32(name='TotalCount'),
}

model DescribeSecretKeysResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSecretKeysResponseBody(name='body'),
}

async function describeSecretKeysWithOptions(request: DescribeSecretKeysRequest, runtime: Util.RuntimeOptions): DescribeSecretKeysResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.secretKeyId)) {
    query['SecretKeyId'] = request.secretKeyId;
  }
  if (!Util.isUnset(request.secretKeyName)) {
    query['SecretKeyName'] = request.secretKeyName;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSecretKeys',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSecretKeys(request: DescribeSecretKeysRequest): DescribeSecretKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSecretKeysWithOptions(request, runtime);
}

model DescribeSystemParametersRequest {
  securityToken?: string(name='SecurityToken'),
}

model DescribeSystemParametersResponseBody = {
  requestId?: string(name='RequestId'),
  systemParameters?: {
    systemParameter?: [ 
    {
      demoValue?: string(name='DemoValue'),
      description?: string(name='Description'),
      paramName?: string(name='ParamName'),
      paramType?: string(name='ParamType'),
    }
  ](name='SystemParameter')
  }(name='SystemParameters'),
}

model DescribeSystemParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeSystemParametersResponseBody(name='body'),
}

async function describeSystemParametersWithOptions(request: DescribeSystemParametersRequest, runtime: Util.RuntimeOptions): DescribeSystemParametersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeSystemParameters',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeSystemParameters(request: DescribeSystemParametersRequest): DescribeSystemParametersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeSystemParametersWithOptions(request, runtime);
}

model DescribeTrafficControlsRequest {
  apiUid?: string(name='ApiUid'),
  groupId?: string(name='GroupId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  stageName?: string(name='StageName'),
  trafficControlId?: string(name='TrafficControlId'),
  trafficControlName?: string(name='TrafficControlName'),
}

model DescribeTrafficControlsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
  trafficControls?: {
    trafficControl?: [ 
    {
      apiDefault?: int32(name='ApiDefault'),
      appDefault?: int32(name='AppDefault'),
      createdTime?: string(name='CreatedTime'),
      description?: string(name='Description'),
      modifiedTime?: string(name='ModifiedTime'),
      specialPolicies?: {
        specialPolicy?: [ 
        {
          specialType?: string(name='SpecialType'),
          specials?: {
            special?: [ 
            {
              specialKey?: string(name='SpecialKey'),
              trafficValue?: int32(name='TrafficValue'),
            }
          ](name='Special')
          }(name='Specials'),
        }
      ](name='SpecialPolicy')
      }(name='SpecialPolicies'),
      trafficControlId?: string(name='TrafficControlId'),
      trafficControlName?: string(name='TrafficControlName'),
      trafficControlUnit?: string(name='TrafficControlUnit'),
      userDefault?: int32(name='UserDefault'),
    }
  ](name='TrafficControl')
  }(name='TrafficControls'),
}

model DescribeTrafficControlsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeTrafficControlsResponseBody(name='body'),
}

async function describeTrafficControlsWithOptions(request: DescribeTrafficControlsRequest, runtime: Util.RuntimeOptions): DescribeTrafficControlsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.apiUid)) {
    query['ApiUid'] = request.apiUid;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.stageName)) {
    query['StageName'] = request.stageName;
  }
  if (!Util.isUnset(request.trafficControlId)) {
    query['TrafficControlId'] = request.trafficControlId;
  }
  if (!Util.isUnset(request.trafficControlName)) {
    query['TrafficControlName'] = request.trafficControlName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeTrafficControls',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeTrafficControls(request: DescribeTrafficControlsRequest): DescribeTrafficControlsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeTrafficControlsWithOptions(request, runtime);
}

model DescribeUserWhiteListsRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  securityToken?: string(name='SecurityToken'),
  type?: string(name='Type'),
  uid?: long(name='Uid'),
}

model DescribeUserWhiteListsResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
  userWhiteListInfos?: {
    userWhiteListInfo?: [ 
    {
      aoneId?: string(name='AoneId'),
      createTime?: string(name='CreateTime'),
      description?: string(name='Description'),
      id?: long(name='Id'),
      modifiedTime?: string(name='ModifiedTime'),
      type?: string(name='Type'),
      uid?: long(name='Uid'),
      value?: string(name='Value'),
    }
  ](name='UserWhiteListInfo')
  }(name='UserWhiteListInfos'),
}

model DescribeUserWhiteListsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserWhiteListsResponseBody(name='body'),
}

async function describeUserWhiteListsWithOptions(request: DescribeUserWhiteListsRequest, runtime: Util.RuntimeOptions): DescribeUserWhiteListsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  if (!Util.isUnset(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserWhiteLists',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeUserWhiteLists(request: DescribeUserWhiteListsRequest): DescribeUserWhiteListsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserWhiteListsWithOptions(request, runtime);
}

model ModifyApiMarketInstanceAttributeRequest {
  aliUid?: string(name='AliUid'),
  groupId?: string(name='GroupId'),
  instanceAttributes?: string(name='InstanceAttributes'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyApiMarketInstanceAttributeResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyApiMarketInstanceAttributeResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyApiMarketInstanceAttributeResponseBody(name='body'),
}

async function modifyApiMarketInstanceAttributeWithOptions(request: ModifyApiMarketInstanceAttributeRequest, runtime: Util.RuntimeOptions): ModifyApiMarketInstanceAttributeResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.instanceAttributes)) {
    query['InstanceAttributes'] = request.instanceAttributes;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApiMarketInstanceAttribute',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyApiMarketInstanceAttribute(request: ModifyApiMarketInstanceAttributeRequest): ModifyApiMarketInstanceAttributeResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyApiMarketInstanceAttributeWithOptions(request, runtime);
}

model ModifyAppRequest {
  appId?: long(name='AppId'),
  appName?: string(name='AppName'),
  description?: string(name='Description'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyAppResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyAppResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAppResponseBody(name='body'),
}

async function modifyAppWithOptions(request: ModifyAppRequest, runtime: Util.RuntimeOptions): ModifyAppResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyApp',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyApp(request: ModifyAppRequest): ModifyAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAppWithOptions(request, runtime);
}

model ModifyAppForInnerRequest {
  aliUid?: long(name='AliUid'),
  appId?: long(name='AppId'),
  appName?: string(name='AppName'),
  description?: string(name='Description'),
  extend?: string(name='Extend'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyAppForInnerResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyAppForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyAppForInnerResponseBody(name='body'),
}

async function modifyAppForInnerWithOptions(request: ModifyAppForInnerRequest, runtime: Util.RuntimeOptions): ModifyAppForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.appName)) {
    query['AppName'] = request.appName;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.extend)) {
    query['Extend'] = request.extend;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyAppForInner',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyAppForInner(request: ModifyAppForInnerRequest): ModifyAppForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyAppForInnerWithOptions(request, runtime);
}

model ModifyGroupAuthAppCodeForBackendRequest {
  aliUid?: long(name='AliUid'),
  authAppCode?: string(name='AuthAppCode'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model ModifyGroupAuthAppCodeForBackendResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyGroupAuthAppCodeForBackendResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyGroupAuthAppCodeForBackendResponseBody(name='body'),
}

async function modifyGroupAuthAppCodeForBackendWithOptions(request: ModifyGroupAuthAppCodeForBackendRequest, runtime: Util.RuntimeOptions): ModifyGroupAuthAppCodeForBackendResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.authAppCode)) {
    query['AuthAppCode'] = request.authAppCode;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyGroupAuthAppCodeForBackend',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyGroupAuthAppCodeForBackend(request: ModifyGroupAuthAppCodeForBackendRequest): ModifyGroupAuthAppCodeForBackendResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyGroupAuthAppCodeForBackendWithOptions(request, runtime);
}

model ResetAppCodeForInnerRequest {
  aliUid?: long(name='AliUid'),
  appCode?: string(name='AppCode'),
  newAppCode?: string(name='NewAppCode'),
  securityToken?: string(name='SecurityToken'),
}

model ResetAppCodeForInnerResponseBody = {
  requestId?: string(name='RequestId'),
}

model ResetAppCodeForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetAppCodeForInnerResponseBody(name='body'),
}

async function resetAppCodeForInnerWithOptions(request: ResetAppCodeForInnerRequest, runtime: Util.RuntimeOptions): ResetAppCodeForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appCode)) {
    query['AppCode'] = request.appCode;
  }
  if (!Util.isUnset(request.newAppCode)) {
    query['NewAppCode'] = request.newAppCode;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetAppCodeForInner',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resetAppCodeForInner(request: ResetAppCodeForInnerRequest): ResetAppCodeForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetAppCodeForInnerWithOptions(request, runtime);
}

model ResetSecretByAppKeyForInnerRequest {
  aliUid?: long(name='AliUid'),
  appKey?: string(name='AppKey'),
  newAppKey?: string(name='NewAppKey'),
  newAppSecret?: string(name='NewAppSecret'),
  securityToken?: string(name='SecurityToken'),
}

model ResetSecretByAppKeyForInnerResponseBody = {
  requestId?: string(name='RequestId'),
}

model ResetSecretByAppKeyForInnerResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetSecretByAppKeyForInnerResponseBody(name='body'),
}

async function resetSecretByAppKeyForInnerWithOptions(request: ResetSecretByAppKeyForInnerRequest, runtime: Util.RuntimeOptions): ResetSecretByAppKeyForInnerResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.appKey)) {
    query['AppKey'] = request.appKey;
  }
  if (!Util.isUnset(request.newAppKey)) {
    query['NewAppKey'] = request.newAppKey;
  }
  if (!Util.isUnset(request.newAppSecret)) {
    query['NewAppSecret'] = request.newAppSecret;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetSecretByAppKeyForInner',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resetSecretByAppKeyForInner(request: ResetSecretByAppKeyForInnerRequest): ResetSecretByAppKeyForInnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetSecretByAppKeyForInnerWithOptions(request, runtime);
}

model SetAccessPermissionByGroupForBackendRequest {
  appId?: long(name='AppId'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model SetAccessPermissionByGroupForBackendResponseBody = {
  instanceId?: string(name='InstanceId'),
  requestId?: string(name='RequestId'),
}

model SetAccessPermissionByGroupForBackendResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetAccessPermissionByGroupForBackendResponseBody(name='body'),
}

async function setAccessPermissionByGroupForBackendWithOptions(request: SetAccessPermissionByGroupForBackendRequest, runtime: Util.RuntimeOptions): SetAccessPermissionByGroupForBackendResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetAccessPermissionByGroupForBackend',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAccessPermissionByGroupForBackend(request: SetAccessPermissionByGroupForBackendRequest): SetAccessPermissionByGroupForBackendResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAccessPermissionByGroupForBackendWithOptions(request, runtime);
}

model SetPurchasedApiGroupStatusRequest {
  aliUid?: long(name='AliUid'),
  billingStatus?: string(name='BillingStatus'),
  closeOrder?: boolean(name='CloseOrder'),
  groupId?: string(name='GroupId'),
  securityToken?: string(name='SecurityToken'),
}

model SetPurchasedApiGroupStatusResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetPurchasedApiGroupStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetPurchasedApiGroupStatusResponseBody(name='body'),
}

async function setPurchasedApiGroupStatusWithOptions(request: SetPurchasedApiGroupStatusRequest, runtime: Util.RuntimeOptions): SetPurchasedApiGroupStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!Util.isUnset(request.billingStatus)) {
    query['BillingStatus'] = request.billingStatus;
  }
  if (!Util.isUnset(request.closeOrder)) {
    query['CloseOrder'] = request.closeOrder;
  }
  if (!Util.isUnset(request.groupId)) {
    query['GroupId'] = request.groupId;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetPurchasedApiGroupStatus',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setPurchasedApiGroupStatus(request: SetPurchasedApiGroupStatusRequest): SetPurchasedApiGroupStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return setPurchasedApiGroupStatusWithOptions(request, runtime);
}

model TagResourcesSystemTagsRequest {
  resourceId?: [ string ](name='ResourceId'),
  resourceType?: string(name='ResourceType'),
  scope?: string(name='Scope'),
  securityToken?: string(name='SecurityToken'),
  tag?: [ 
    {
      key?: string(name='Key'),
      value?: string(name='Value'),
    }
  ](name='Tag'),
  tagOwnerBid?: string(name='TagOwnerBid'),
  tagOwnerUid?: long(name='TagOwnerUid'),
}

model TagResourcesSystemTagsResponseBody = {
  requestId?: string(name='RequestId'),
}

model TagResourcesSystemTagsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TagResourcesSystemTagsResponseBody(name='body'),
}

async function tagResourcesSystemTagsWithOptions(request: TagResourcesSystemTagsRequest, runtime: Util.RuntimeOptions): TagResourcesSystemTagsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  if (!Util.isUnset(request.scope)) {
    query['Scope'] = request.scope;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  if (!Util.isUnset(request.tag)) {
    query['Tag'] = request.tag;
  }
  if (!Util.isUnset(request.tagOwnerBid)) {
    query['TagOwnerBid'] = request.tagOwnerBid;
  }
  if (!Util.isUnset(request.tagOwnerUid)) {
    query['TagOwnerUid'] = request.tagOwnerUid;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'TagResourcesSystemTags',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function tagResourcesSystemTags(request: TagResourcesSystemTagsRequest): TagResourcesSystemTagsResponse {
  var runtime = new Util.RuntimeOptions{};
  return tagResourcesSystemTagsWithOptions(request, runtime);
}

model VipMigrationRequest {
  newVip?: string(name='NewVip'),
  originalVip?: string(name='OriginalVip'),
  securityToken?: string(name='SecurityToken'),
}

model VipMigrationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
}

async function vipMigrationWithOptions(request: VipMigrationRequest, runtime: Util.RuntimeOptions): VipMigrationResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.newVip)) {
    query['NewVip'] = request.newVip;
  }
  if (!Util.isUnset(request.originalVip)) {
    query['OriginalVip'] = request.originalVip;
  }
  if (!Util.isUnset(request.securityToken)) {
    query['SecurityToken'] = request.securityToken;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'VipMigration',
    version = '2016-02-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'none',
  };
  return callApi(params, req, runtime);
}

async function vipMigration(request: VipMigrationRequest): VipMigrationResponse {
  var runtime = new Util.RuntimeOptions{};
  return vipMigrationWithOptions(request, runtime);
}

